package com.smart.thrift.annotation;


import org.springframework.core.annotation.AliasFor;

import java.lang.annotation.*;

@Target({ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface ThriftReference {

    @AliasFor(annotation = ThriftReference.class, attribute = "name")
    String value() default "";

    /**
     * 名称不为空根据类型和名称注入
     * @return
     */
    @AliasFor(annotation = ThriftReference.class, attribute = "value")
    String name() default "";

    /**
     * 当前提供服务的版本号，默认只有一个实现类
     * @return
     */
    double version() default 1.0;

    /**
     * Thrift服务id,客户端可以指定使用serverId调用
     * @return
     */
    String serverId() default "";

}
